package com.bwie.remote.factory;

import com.bwie.common.domain.Menu;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.remote.RemoteService;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @className: RemoteServiceFactory
 * @Description: TODO
 * @version: v1.８.0
 * @author: GONGWENXUE
 * @date: 2025/10/22 9:29
 */
@Service
public class RemoteServiceFactory implements FallbackFactory<RemoteService> {
    @Override
    public RemoteService create(Throwable cause) {
        return new RemoteService() {
            @Override
            public Result<User> selectNameByUser(String username) {
                return Result.error("异常");
            }

            @Override
            public Result<User> selectPhoneByUser(String phone) {
                return Result.error("异常");
            }

            @Override
            public Result<List<Menu>> getMenu(Integer userId) {
                return Result.error("异常");
            }
        };
    }
}
